//package club.hicode.daydayup.hystric;
//
//import cn.hutool.core.util.StrUtil;
//import com.google.common.base.Equivalence;
//import jodd.util.StringUtil;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.experimental.var;
//import org.junit.Test;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.concurrent.ExecutionException;
//
///**
// * 熔断的测试和学习
// *
// * @author Liu Chunfu
// * @date 2018-07-16 下午4:56
// **/
//public class HystricTest1 {
//
//    @Test
//    public void test1() throws ExecutionException, InterruptedException {
//        HelloWorldCommand command = new HelloWorldCommand(() -> "test-1", 3000);
//
//
//        //同步的方式调用
//    /*    String execute = command.execute();
//        System.out.println(execute);*/
//
//        //异步的方式调用
// /*       Future<String> queue = command.queue();
//        String s = queue.get();
//        System.out.println(s);*/
//
//
////        Observable<String> observe = command.observe();
////        observe.subscribe(new Observer<String>() {
////            @Override
////            public void onCompleted() {
////                System.out.println("成功...");
////            }
////
////            @Override
////            public void onError(Throwable throwable) {
////                System.out.println("error");
////            }
////
////            @Override
////            public void onNext(String s) {
////                System.out.println("下一步操作..." + s);
////            }
////        });
//
//        Thread.sleep(70000);
//    }
//
//    @Test
//    public void testLambda() {
//        String s = "123";
//        Wrapper wrapper = new Wrapper(s);
//        List<String> list = new ArrayList<>();
//        StringBuilder builder = new StringBuilder();
//        list.stream().forEach(x -> {
//            Object object = wrapper.getObject();
//            wrapper.setObject(object + x);
//        });
//    }
//
//
//    @AllArgsConstructor
//    @Data
//    class Wrapper {
//        private Object object;
//    }
//}
